package io.sunny.platform.ai.deepseek.sql.result;

import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @Author SUNNY
 * @Date 2025/11/6 16:56
 * @PackageName: io.sunny.platform.ai.deepseek.sql.result
 * @Description: 查询结果
 * @Version 1.0
 */
@Data
public class QueryResult {
    private List<Map<String, Object>> results;

    private String generatedSql;

    private String errorMessage;

    private QueryResult(List<Map<String, Object>> results, String generatedSql) {
        this.results = results;
        this.generatedSql = generatedSql;
    }

    private QueryResult(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public static QueryResult success(List<Map<String, Object>> results, String generatedSql) {
        return new QueryResult(results, generatedSql);
    }

    public static QueryResult error(String errorMessage) {
        return new QueryResult(errorMessage);
    }
}
